package main

import (
	"fmt"
	"net"
	"net/rpc"
)


type Test struct{

}
func (t *Test)Hello(name string,resp *string)error{
	*resp="hello"+name
	return nil
}
func main(){

	rpc.RegisterName("beifeng",new(Test))
	Listener, error:=net.Listen("tcp","0.0.0.0:9501")

	if error!=nil{
		return
	}

	for {
		Conn, error:=Listener.Accept()

		if error!=nil{
			fmt.Println("accept error")
		}

		go rpc.ServeConn(Conn)


	}
}
